<?php

namespace app\admin\model;

use think\Model;

class Order extends Model
{
    // 表名
    protected $name = 'order';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    
    // 追加属性
    protected $append = [
        'oeder_time_text'
    ];
    

    
    public function getOrderTimeAttr($value, $data)
    {
        return  date('Y-m-d H:i:s',$value);
    }



    public function getOederTimeTextAttr($value, $data)
    {
        // $value = $value ? $value : $data['oeder_time'];
        return 123123;
    }

    protected function setOrderTimeAttr($value)
    {
         if(is_numeric($value)){
            return $value;
        }else{
            return strtotime($value);
        }
    }


}
